import { lazy,Suspense } from 'react';
import {useRoutes} from 'react-router-dom'
import Home from '../views/Home'
const About = lazy(()=>import('../views/About'))
// import About from '../views/About'
const RouterView = () => {
  const routes = useRoutes([
    {
      path: "/",
      element: <Home/>
    }, {
      path: "/about",
      element:<Suspense fallback={<div>loading</div>}>
          <About/>
      </Suspense>

    }
  ])
  return routes;
}
export default RouterView;